<template>
	<view class="bg-white">
		<cu-custom bgColor="bg-white" :isBack="true">
			<block slot="content">退宿申请详情</block>

		</cu-custom>
		<view style="position: relative;" class="padding bg-white">
			<view class="text-cut padding" style="background-color: #F3F5FC ;color: #696969;border-radius: 15px;">
				完成时间：<text style="padding-left: 30px;">{{finishTime}}</text>
			</view>
			<view
				style="position: absolute; right: 17px; top: 17px;border-radius: 0rpx 20rpx 0rpx 20rpx; background-color: #CECECE;color: #FFFFFF;">
				<text>已完成</text>
			</view>

		</view>

		<view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					公司
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					<view style="background-color: #f9f9f9;padding: 5px 10px;margin-top: -5px;">

						</image>
						<text>
							{{dataObj.company_dictText}}
						</text>
					</view>
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					工号
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.workNo}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					姓名
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.userId_dictText}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					性别
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.sex_dictText}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					年龄
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.age}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					进厂时间
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					<!-- {{dataObj.workStartTime}} -->
					{{dataObj.workStartTime != null ? dataObj.workStartTime.replaceAll('-','/') : null}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					部门
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					<view style="background-color: #f9f9f9;padding: 5px 10px;margin-top: -5px;">

						</image>
						<text>
							{{dataObj.orgCodeTxt}}
						</text>
					</view>
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					车间
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.workshop}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					岗位
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.post}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					班次
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.classes}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					楼栋
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.buildingId_dictText}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					楼层
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.floorId_dictText}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					宿舍号
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.roomCode}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					宿舍属性
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.roomType_dictText}}
				</view>
			</view>

			<!-- <view style="background-color: #FFFFFF;">
				<view style="margin-top: 15px; ">
					<view class="action" style="margin-bottom: 10px;">
						<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
						<text style="color: #000000;font-weight: bold;font-size: 30rpx;">
							物品交接
						</text>
					</view>
					<view style="padding:0 30rpx;" v-for="(item,index) in handovers">
						<view style="background-color: rgba(244, 244, 244, 1);" class="flex">
							<view class="flex-sub padding-sm margin-xs radius">
								品名
							</view>
							<view class="flex-sub padding-sm margin-xs radius">
								{{item.name}}
							</view>
						</view>
						<view style="background-color: rgba(244, 244, 244, 1);" class="flex">
							<view class="flex-sub padding-sm margin-xs radius">
								规格
							</view>
							<view class="flex-sub padding-sm margin-xs radius">
								{{item.specs}}
							</view>
						</view>
						<view style="background-color: rgba(244, 244, 244, 1);" class="flex">
							<view class="flex-sub padding-sm margin-xs radius">
								单位
							</view>
							<view class="flex-sub padding-sm margin-xs radius">
								{{item.unit}}
							</view>
						</view>
						<view style="background-color: rgba(244, 244, 244, 1);" class="flex">
							<view class="flex-sub padding-sm margin-xs radius">
								数量
							</view>
							<view class="flex-sub padding-sm margin-xs radius">
								{{item.num}}
							</view>
						</view>
						<view style="background-color: rgba(244, 244, 244, 1); margin-bottom: 30rpx;" class="flex">
							<view class="flex-sub padding-sm margin-xs radius">
								备注
							</view>
							<view class="flex-sub padding-sm margin-xs radius">
								{{item.remark}}
							</view>
						</view>
					</view>

				</view>
			</view> -->

		</view>



		<view style="margin-top: 15px;">
			<view class="action" style="margin-bottom: 10px;">
				<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
				<text style="color: #000000;font-weight: bold;font-size: 30rpx;">
					审批记录
				</text>
			</view>
			<view style="background-color: #f4f4f4;border-radius: 10px;margin-top: 10px;">
				<view class="cu-timeline" v-for="(item,index) in approvalRecords">
					<view class="cu-item text-green cuIcon-roundcheckfill">
						<view style="display: flex;color: #000000;">
							<view style="width: 25px;">
								<text
									style="margin-left: -18px;margin-top: 5px;display: block;font-weight: bold;">{{item.currentNodeDictText}}</text>
							</view>
							<view style="margin-left: 20px;">
								<view>
									<text style="font-size: 28rpx;">{{item.approverDictText}}</text>
									<text
										style="display: inline-block;padding: 2px;background-color: #d9d9d9;border-radius: 5px;font-size: 16rpx;margin-left: 10px;color: #a1a1a1;">{{item.remark}}</text>
                  <text v-if="item.approvalStatusDictText == '同意'"
                        style="display: inline-block;padding: 4rpx 10rpx;background-color: #34b483;border-radius: 5px;font-size: 16rpx;margin-left: 15px;color: #FFFFFF;">{{item.approvalStatusDictText}}</text>
                  <text v-if="item.approvalStatusDictText == '待审'"
                        style="display: inline-block;padding: 4rpx 10rpx;background-color: #c6ffbe;border-radius: 5px;font-size: 16rpx;margin-left: 15px;color: #48B237;">{{item.approvalStatusDictText}}</text>
                  <text v-if="item.approvalStatusDictText == '驳回'"
                        style="display: inline-block;padding: 4rpx 10rpx;background-color: #f5222d;border-radius: 5px;font-size: 16rpx;margin-left: 15px;color: #FFFFFF;">{{item.approvalStatusDictText}}</text>
                  <text v-if="item.approvalStatusDictText == '结束'"
                        style="display: inline-block;padding: 4rpx 10rpx;background-color: #D9D9D9;border-radius: 5px;font-size: 16rpx;margin-left: 15px;color: #A0A0A0;">{{item.approvalStatusDictText}}</text>
								</view>
								<view>
									<text style="font-size: 24rpx;">{{item.approvalTypeDictText}}</text>
									<text
										style="font-size: 20rpx;color: #c7c7c7;margin-left: 15px;">{{item.createTime}}</text>
								</view>
							</view>

						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import moment from 'moment';
	export default {
		data() {
			return {
				finishTime: '2023/09/21 14:00:23',
				dataObj: {
					title: '福建省立华智纺科技',
					building: '1栋',
					floor: '3层',
					dormitoryProperties: '夫妻房',
					reason: '这里是原因',
					times: '2',
					byHandle: '小张',
					remark: '12333',
					dormitoryNumber: '301',
					habitable: '4',
					resided: '2',
					isFull: '是',
					handledBy: '小张',
					updateUser: '张果冻',
					updateTime: '2023/10/10',
					workNumber: '123344',
					name: '小张',
					sex: '男',
					age: '23',
					workTime: '2023/10/10',
					department: '细沙-XS',
					workshop: '某某车间',
					station: '某某岗位',
					classes: '某某班次',

				},
				articleObj: {
					name: '凳子',
					spece: '规格1',
					unit: '个',
					number: '2',
					remark: '无'
				},
				handovers: [{

				}],
				approvalRecords: [{
					title: '总经理',
					name: '陈婷婷',
					area: '手写区域',
					state: '同意',
					manager: '企管',
					dateTime: '2023/10/10 12:00'
				}, {
					title: '车间',
					name: '陈婷婷',
					area: '手写区域',
					state: '同意',
					manager: '企管',
					dateTime: '2023/10/10 12:00'
				}, {
					title: '填写申请单',
					name: '陈婷婷',
					area: '手写区域',
					state: '提交',
					manager: '企管',
					dateTime: '2023/10/10 12:00'
				}]
			}
		},
		mounted() {
			this.getDetail()
		},
		computed: {

		},
		onLoad: function(options) {
			this.dataObj.id = options.id;
			// 在这里可以使用获取到的 id 参数进行后续操作
		},
		methods: {
			getDetail() {
				this.$http.get(
						"/crm_dormitory_refund_application/crmDormitoryRefundApplication/queryDetail/" + this.dataObj.id)
					.then(res => {
						if (res.data.success) {
							this.dataObj = res.data.result
							// this.dataObj['avatar'] = this.getFileAccessHttpUrl(this.dataObj['avatar'])
							// console.log(this.dataObj['avatar'])
							this.approvalRecords = this.dataObj.approvalRecords
							this.handovers = this.dataObj.handovers
						}
					})
			},
			searchBtn() {
				console.log(this.searchValue)
			},
			urging(id) {
				const params = {
					applicationId: id,
					approvalType: 1
				}
				this.$http.get("/crm_on_hand/crmOnHand/urge",{params:params})
					.then(res => {
						if (res.data.success) {
							this.$refs.urgingPopup.open('center')
						}
					})
			},
			details() {
				console.log('历史换宿信息')
			},
		}
	}
</script>

<style lang="scss" scoped>
	image {
		width: 100%;
		height: 100%;
	}

	.blackList {
		height: 100%;
		overflow: hidden;
	}

	.page-search {
		padding-left: 34rpx;
		margin-bottom: 12rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.search {
		width: 680rpx;
		height: 86rpx;
		background-color: rgba(249, 249, 249, 1);
		border-radius: 60rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		padding-left: 24rpx;
		padding-right: 24rpx;

		.search-left {
			width: 28rpx;
			height: 28rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.search-center {
			margin-left: 22rpx;
		}

		.search-placeholder {
			font-size: 28rpx;
			font-weight: 400;
			color: #7C7C7C;
		}


	}

	.filter-btn {
		width: 40rpx;
		height: 40rpx;
		margin-right: 42rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.page-content-main {
		height: calc(100% - 12rpx - 86rpx);
		border-top-left-radius: 64rpx;
		border-top-right-radius: 64rpx;
		padding: 26rpx 34rpx 0 34rpx
	}

	.select-box {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;

	}

	.select {
		width: 160rpx;
		height: 74rpx;
		border-radius: 60rpx;
		background-color: #4591FE;
		margin-bottom: 20rpx;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		margin-right: 48rpx;
		position: relative;

		.select-value {
			font-size: 28rpx;
			font-weight: 400;
			color: #FFFFFF;
			margin-right: 18rpx;
		}

		.select-icon {
			width: 22rpx;
			height: 22rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			position: absolute;
			right: 20rpx;
			top: 25rpx;
		}
	}

	.list {
		height: calc(100% - 74rpx - 20rpx);
	}

	.list-item {
		border-radius: 28rpx;
		background-color: #FFFFFF;
		padding: 26rpx 24rpx 28rpx 20rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		margin-bottom: 26rpx;
		position: relative;

		.list-item-leftCenter {
			display: flex;
			flex-direction: row;
		}

		.list-item-left {
			width: 86rpx;
			height: 86rpx;
			margin-right: 26rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.list-item-center {
			.list-item-row {
				display: flex;
				flex-direction: row;
				margin-bottom: 20rpx;

				.list-item-name {
					color: #101317;
					font-size: 32rpx;
					margin-right: 16rpx;
				}

				.list-item-sex {
					width: 106rpx;
					height: 42rpx;
					border-top-right-radius: 40rpx;
					border-bottom-right-radius: 40rpx;
					border-bottom-left-radius: 20rpx;
					background-color: rgba(234, 171, 78, 0.35);
					line-height: 42rpx;
					text-align: center;
					color: rgba(255, 173, 4, 1);
					font-size: 24rpx;
				}

				.list-item-row-icon {
					width: 38rpx;
					height: 38rpx;
					margin-right: 10rpx;
					display: flex;
					justify-content: center;
					align-items: center;
				}

				.list-item-row-title,
				.list-item-row-value {
					font-size: 24rpx;
					font-weight: 400;
					color: #101317;
					line-height: 38rpx;
				}

			}
		}

		.list-item-btn {
			width: 36rpx;
			height: 36rpx;
			margin-top: 56rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.list-item-tab {
			width: 132rpx;
			height: 56rpx;
			text-align: center;
			line-height: 56rpx;
			background-color: rgba(69, 145, 254, 0.4);
			position: absolute;
			top: 0;
			right: 0;
			border-top-right-radius: 26rpx;
			border-bottom-left-radius: 20rpx;
		}

		.list-item-tab-text {
			font-size: 26rpx;
			color: rgba(69, 145, 254, 1)
		}
	}

	.nav-right-image {
		width: 80rpx;
		height: 80rpx;
		margin-left: 15px;
	}

	.fun-wrap {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(3, 3, 3, 0.28);
		z-index: 10000;
	}

	.fun-box {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		flex-wrap: wrap;
		width: 556rpx;
		height: 444rpx;
		border-top-left-radius: 42rpx;
		border-bottom-left-radius: 42rpx;
		border-bottom-right-radius: 42rpx;
		position: absolute;
		right: 74rpx;
		background-color: #FFFFFF;
		padding-top: 35rpx;
	}

	.fun-item {
		width: 185rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		margin-bottom: 44rpx;
	}

	.fun-icon {
		width: 92rpx;
		height: 92rpx;
		margin-bottom: 22rpx;
	}

	.cu-form-group {
		background-color: transparent;
	}

	::v-deep {
		.cu-form-group uni-picker .picker {
			color: #FFFFFF;
		}

		.cu-form-group uni-picker::after {
			opacity: 0;
		}
	}

	.textView {
		margin-left: 25px;
		font-size: 10px;
		margin-top: 5px;
	}

	.listText {
		width: 148rpx;
		height: 24rpx;
		font-size: 20rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		color: #000000;
		line-height: 24rpx;
	}
</style>
